fix(deps): migrate nostr crate from 0.36 to 0.44#708
Merged
Conversation
b1cc86f to
2e3000e
Compare
Breaking changes addressed: - EventBuilder::new switched from 3-arg to builder pattern (.tags()) - Tag::parse no longer takes a reference (&[...] → [...]) - generate_shared_key returns Result — added ? / .map_err / .unwrap() - nip44 and nip98 features must now be explicit - PublicKey.serialize() renamed to .to_bytes()/.as_bytes() - nostr::bitcoin::* re-exports removed — now nostr::secp256k1::* and nostr::hashes::* - RelayMessage and ClientMessage gained lifetime parameters - UncheckedUrl removed — replaced by Url/RelayUrl - EventBuilder::auth now requires RelayUrl not url::Url - Filter::custom_tag takes a single S: Into<String>; use custom_tags for slices - ConversationKey::derive and Timestamp::as_u64 now deprecated/return Result - nostr::util::hex removed — use hex crate directly - nostr-compat alias removed from desktop (now same version as nostr)
- Fix EventBuilder::auth to use RelayUrl instead of Url (3 sites) - Fix custom_tag → custom_tags for array arguments (2 sites) - Fix cargo fmt violations from mechanical replacement - Replace deprecated Timestamp::as_u64() with as_secs() (8 sites) - Remove stale Compat* type aliases from identity.rs - Remove redundant use nostr statement from agents.rs
The previous commit ran cargo fmt at the root workspace but missed the desktop/src-tauri workspace which has its own Cargo.toml.
Remove unused XOnlyPublicKey import, explicit auto-deref on raw_key, and needless borrow on SECP256K1 constant.
- Replace deprecated Timestamp::as_u64() with as_secs() across all crates - Remove unused Url imports in sprout-mcp and sprout-acp - Fix Tag::parse trait bound error in sprout-acp test - Fix XOnlyPublicKey usage in git-sign-nostr test code
Same Timestamp::as_u64() → as_secs() migration as the root workspace, applied to the desktop/src-tauri crate which has its own Cargo.toml.
PR #719 (NIP-23 long-form notes) merged to main with pre-0.44 API calls. Apply the same EventBuilder and Tag::parse migrations. Also fix matching dms.rs breakage (same Tag::parse/EventBuilder::new pattern) that blocked compilation, and replace the deprecated Timestamp::as_u64() with as_secs() in notes.rs.
PR #719 E2E test file and notes.rs test code still used deprecated Timestamp::as_u64(), old Tag::parse(&[]) signature, 3-arg EventBuilder::new(), and array-form custom_tag().
PR #726 introduced new code using old nostr 0.36 patterns: - EventBuilder::new() 3-arg form → 2-arg + .tags() - PublicKey::serialize() → .to_bytes() - Tag::parse(&[...]) → Tag::parse([...]) in e2e_git tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nostrfrom 0.36 to 0.44 across the entire workspace (81 files, ~1100 lines changed)Breaking changes addressed
EventBuilder::new— migrated from 3-arg(kind, content, tags)to builder pattern.new(kind, content).tags(tags)across 222 call sites in 55 filesTag::parse— removed reference on slice argument (&[...]→[...]) across 304 call sites in 42 filesgenerate_shared_key— now returnsResult, added error handling at 9 call sitesPublicKey::serialize()— removed, replaced with.to_bytes()/.as_bytes()at 55 call sites in 15 filesnostr::bitcoin::*re-exports — removed, switched tonostr::secp256k1::*andnostr::hashes::*nostr::util::hex— removed, switched tohexcrate directly (addedhexdep tosprout-proxy)RelayMessage/ClientMessage— gained lifetime parameters, adapted proxy code to carry raw JSON strings instead of borrowingEventBuilder::auth— now takesRelayUrlinstead ofurl::UrlFilter::custom_tag— changed to single-value; switched tocustom_tags()for multi-valuenip44/nip98— features no longer default, now explicit in workspaceCargo.tomlnostr-compat— removed entirely fromdesktop/src-tauri/Cargo.tomlsince both versions are now 0.44; migrated allnostr_compat::references tonostr::Timestamp::as_u64()— deprecated in favor ofas_secs(), updated in key call sites (some deprecation warnings remain)